<template>
  <PcList :items="result" style="height: 560px;border: none" type="table">
    <template #default="{item}">
      <tr>
        <td v-for="icon in item" :key="icon">
          <div class="icon-box">
            <div class="left">
              <pc-icon :icon="icon"/>
            </div>
            <div class="right">{{ icon }}</div>
          </div>
        </td>
      </tr>
    </template>
  </PcList>
</template>

<script lang="ts" setup>
import iconArr from './iconArr.json'

let chunkSize = 5; // 这是你想要的每个子数组的大小
let result: any = [];

for (let i = 0; i < iconArr.length; i += chunkSize) {
  result.push(iconArr.slice(i, i + chunkSize));
}
</script>


<style lang="scss" scoped>
td {
  height: 50px !important;
  width: 200px;

  .icon-box {
    display: flex;
    gap: 20px;

    .left {
      width: 30px;
      text-align: center;
    }

    .right {
      max-width: calc(100% - 30px);
      flex-grow: 1;
      font-size: 12px;
      text-align: left;
    }
  }
}
</style>